DestroyCollider = {};
local this = DestroyCollider;

local gameObject;
local transform;

function DestroyCollider.New()
	gameObject = GameObject.Find("DestroyCollider");
	transform = gameObject.transform;
	
	local luaTrigger = gameObject:AddComponent(typeof(LuaTrigger2D));
	luaTrigger:SetExitFunc(this.OnTriggerExit, nil);
end

function DestroyCollider.OnTriggerExit(collision)
	if(collision:CompareTag("PlayerBullet")) then
		poolMgr:Release("PlayerBullet", collision.gameObject);
	elseif(collision:CompareTag("EnemyBullet")) then
		poolMgr:Release("EnemyBullet", collision.gameObject);
	end
end 